import requests
#地址栏添加参数www.xxx.com/?key1=value1&key2=value2
#{key1:value1}
#response=requests.get("https://www.baidu.com/s?wd=python")

'''
还可以params传参
data={'wd':'java'}
response=requests.get("https://www.baidu.com/s",params=data)
print(response.url)



headers={
    "User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"
}
response=requests.get("https://www.baidu.com/s")
print(response.status_code)
print(response.content.decode("utf-8"))
'''


response=requests.get("https://www.baidu.com/")
print(response.status_code)
print(response.content.decode("utf-8"))
